import request from "@/utils/request";

// 运价-列表V1
// export const transportCostList = data =>
//   request({
//     url: `/channel/transport-cost/index`,
//     method: 'post',
//     data,
//   })
// 运价-列表V1
export const transportCostList = (data) =>
  request({
    url: `/channel/ctc/index`,
    method: "post",
    data,
  });
// 运价-详情v1
// export const transportCostDetail = params =>
//   request({
//     url: `/channel/transport-cost/detail`,
//     method: 'get',
//     params,
//   })
// 运价-详情v2
export const transportCostDetail = (params) =>
  request({
    url: `/channel/ctc/detail`,
    method: "get",
    params,
  });

//获取渠道运价相关选项
export const channelCtcOpts = (params) =>
  request({
    url: `/channel/ctc/opts`,
    method: "get",
    params,
  });

// 区域管理-创建
export const createTransportCost = (data) =>
  request({
    url: `/channel/transport-cost/create`,
    method: "post",
    data,
  });

// 运价表明细-编辑
export const updateTransportCost = (data) =>
  request({
    url: `/channel/transport-cost/update`,
    method: "post",
    data,
  });

// 区域管理-删除
export const deleteTransportCost = (data) =>
  request({
    url: `/channel/transport-cost/delete`,
    method: "post",
    data,
  });

// 区域管理-启用禁用
export const statusTransportCost = (data) =>
  request({
    url: `/channel/transport-cost/status`,
    method: "post",
    data,
  });

//获取邮编区域数据
export const zipCodeRegion = (data) =>
  request({
    url: `opts/zip-code-region`,
    method: "post",
    data,
  });

//渠道管理-运价表明细-获取渠道运价文件下拉
export const transportCostFile = (data) =>
  request({
    url: `/channel/dm/get-transport-cost-file`,
    method: "post",
    data,
  });
//渠道管理-运运价表-批量分配不可发邮编区域
export const batchAssignZipCodeRegion = (data) =>
  request({
    url: `/channel/transport-cost/batch-zip-code`,
    method: "post",
    data,
  });

//获取邮编区域下拉数据
export const getZipCodeRegion = (data) =>
  request({
    url: `/opts/zip-code-region`,
    method: "post",
    data,
  });
